<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="HistoricoUnidadCreateDlg" widgetVar="HistoricoUnidadCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.CreateHistoricoUnidadTitle}">

            <h:form id="HistoricoUnidadCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{historicoUnidadController.selected != null}">

                        <p:outputLabel value="#{bundle.CreateHistoricoUnidadLabel_creationDate}" for="creationDate" />
                        <p:calendar id="creationDate" pattern="MM/dd/yyyy HH:mm:ss" value="#{historicoUnidadController.selected.creationDate}" title="#{bundle.EditHistoricoUnidadTitle_creationDate}" required="true" requiredMessage="#{bundle.EditHistoricoUnidadRequiredMessage_creationDate}" showOn="button"/>

                        <p:outputLabel value="#{bundle.CreateHistoricoUnidadLabel_createdBy}" for="createdBy" />
                        <p:inputText id="createdBy" value="#{historicoUnidadController.selected.createdBy}" title="#{bundle.CreateHistoricoUnidadTitle_createdBy}" required="true" requiredMessage="#{bundle.CreateHistoricoUnidadRequiredMessage_createdBy}"/>

                        <p:outputLabel value="#{bundle.CreateHistoricoUnidadLabel_lastUpdateDate}" for="lastUpdateDate" />
                        <p:calendar id="lastUpdateDate" pattern="MM/dd/yyyy HH:mm:ss" value="#{historicoUnidadController.selected.lastUpdateDate}" title="#{bundle.EditHistoricoUnidadTitle_lastUpdateDate}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.CreateHistoricoUnidadLabel_lastUpdateBy}" for="lastUpdateBy" />
                        <p:inputText id="lastUpdateBy" value="#{historicoUnidadController.selected.lastUpdateBy}" title="#{bundle.CreateHistoricoUnidadTitle_lastUpdateBy}" required="true" requiredMessage="#{bundle.CreateHistoricoUnidadRequiredMessage_lastUpdateBy}"/>

                        <p:outputLabel value="#{bundle.CreateHistoricoUnidadLabel_idUnidad}" for="idUnidad" />
                        <p:selectOneMenu id="idUnidad" value="#{historicoUnidadController.selected.idUnidad}" required="true" requiredMessage="#{bundle.EditHistoricoUnidadRequiredMessage_idUnidad}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{unidadController.items}"
                                           var="idUnidadItem"
                                           itemValue="#{idUnidadItem}"
                                           itemLabel="#{idUnidadItem.id.toString()}"
                                           />
                            <f:converter binding="#{unidadConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.CreateHistoricoUnidadLabel_idSocio}" for="idSocio" />
                        <p:selectOneMenu id="idSocio" value="#{historicoUnidadController.selected.idSocio}" required="true" requiredMessage="#{bundle.EditHistoricoUnidadRequiredMessage_idSocio}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{socioController.items}"
                                           var="idSocioItem"
                                           itemValue="#{idSocioItem}"
                                           itemLabel="#{idSocioItem.id.toString()}"
                                           />
                            <f:converter binding="#{socioConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{historicoUnidadController.saveNew}" value="#{bundle.Save}" update="display,:HistoricoUnidadListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,HistoricoUnidadCreateDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="HistoricoUnidadCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
